$(function () {
    if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0" || $.browser.version == "8.0")) {
        AlertError("鉴于你的浏览器版偏低，部分功能将无法使用和获得最佳体验，建议使用谷歌、火狐、IE10以上版本或极速模式下的国产浏览器等浏览。", 10000);
    }
    if (isSafari())//如果是Safari浏览器，隐藏（因为在question和exam/questionlist.aspx下打开时找不到页面）
    {
        $("#divSafari").hide();
    }
    $("#" + $("#hidMenuID").val()).addClass("current");

    var left = 50;
    if ($("#hidTopControlISA").val() == "Y") {
        $("#imguser").css("padding", "0px 20px");
        left = 0;
    }
    $("#imguser,#divUserInfo").hover(function () {
        $("#divUserInfo").css("border-top", "none").css({ left: $("#imguser").offset().left - $("#divRightPanel").width() + $("#imguser").width() + $("#manage").width() - left }).show();
        $("#imguser").removeClass("topbannerbg").css("background", "#4B5564");
    }, function () {
        $("#imguser").css("background", "").addClass("topbannerbg");
        $("#divUserInfo").hide();
    });

    $("#setting,#divQuickMenu").hover(function () {
        $("div.top a").removeClass("current");
        $("#divQuickMenu").css("border-top", "none").css({ left: $("#setting").offset().left - 1 }).show();
        $("#setting").addClass("current");
    }, function () {
        $("#" + $("#hidMenuID").val()).addClass("current");
        $("#divQuickMenu").hide();
        $("#setting").removeClass("current");
    });

    $("#resource,#divResource").hover(function () {
        $("div.top a").removeClass("current");
        $("#divResource").css({ left: $("#resource").offset().left - 1 }).show();
        $("#resource").addClass("current");
    }, function () {
        $("#" + $("#hidMenuID").val()).addClass("current");
        $("#divResource").hide();
        $("#resource").removeClass("current");
    });
    if ($("#hidDeployVersion").val() == "Exam")
    {
        $("a[type=quickmenulesson]").hide();
    }
});
function openFeedback() {
    var diag = new Dialog();
    diag.Width = 1000;
    diag.Height = 530;
    diag.Title = "联系我们";
    diag.CancelEvent = function () {
        diag.close();
    };
    //兼容苹果浏览器
    var prefixURL = "../../";
    if (isSafari()) {
        prefixURL = "";
    }
    diag.URL = addURLTimeStamp(prefixURL + "Cloud/Main/FeedBack.html");
    diag.show();

}
function openUser() {
    var diag = new Dialog();
    diag.Width = 1100;
    diag.Height = $(window).height() - 100;
    diag.Title = "我的信息";
    diag.CancelEvent = function () {
        diag.close();
    };
    //兼容苹果浏览器
    var prefixURL = "../../";
    if (isSafari()) {
        prefixURL = "";
    }
    diag.URL = addURLTimeStamp(prefixURL + "Cloud/Sys/User.html?t=cloud&a=20180314");
    diag.show();
}
//考试分析
function doOpenExamAnalysis() {
    var diag = new Dialog();
    diag.Width = $(window).width() - 90;
    diag.Height = $(window).height() - 100;
    diag.Title = "考试分析";
    diag.CancelEvent = function () {
        diag.close();
    };
    //兼容苹果浏览器
    var prefixURL = "../../";
    if (isSafari()) {
        prefixURL = "";
    }
    diag.URL = addURLTimeStamp(prefixURL + "Cloud/exam/ExamAnalysis.html?treeTypeCode=ExamArrange");
    diag.show();
}

function doOpenQuestionAnalysis(arrangeID) {
    var diag = new Dialog();
    diag.Width = $(window).width() - 90;
    diag.Height = $(window).height() - 100;
    diag.Title = "试题分析";
    diag.CancelEvent = function () {
        diag.close();
    };
    //兼容苹果浏览器
    var prefixURL = "../../";
    if (isSafari()) {
        prefixURL = "";
    }
    diag.URL = addURLTimeStamp(prefixURL + "Cloud/exam/QuestionAnalysis.html?arrangeID=" + arrangeID);
    diag.show();
}